/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ContactWay.java
 *
 * Created on 23 Απρ 2011, 8:49:36 μμ
 */
package help;

import java.util.logging.Level;
import myComponents.myGUI.MyDraggable;
import myComponents.myGUI.buttons.MyAbstractButton;
import tools.MySeriesLogger;
import tools.Skin;

/**
 *
 * @author ssoldatos
 */
public class ContactWay extends MyDraggable {
  private static final long serialVersionUID = 836417896176471L;
  public static final int NONE = 0;
  public static final int EMAIL = 1;
  public static final int GOOGLE_CODE =2;
  public int way = NONE;

  /** Creates new form ContactWay */
  public ContactWay() {
    myseriesproject.MySeries.glassPane.activate(null);
    MySeriesLogger.logger.log(Level.INFO, "Initializing components");
    initComponents();
    MySeriesLogger.logger.log(Level.FINE, "Components initialized");
    setLocationRelativeTo(null);
    setVisible(true);
  }

  /** This method is called from within the constructor to
   * initialize the form.
   * WARNING: Do NOT modify this code. The content of this method is
   * always regenerated by the Form Editor.
   */
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    outer = new javax.swing.JPanel();
    jPanel1 = new javax.swing.JPanel();
    jScrollPane1 = new javax.swing.JScrollPane();
    jTextArea1 = new javax.swing.JTextArea();
    jLabel1 = new javax.swing.JLabel();
    bt_cancel = new myComponents.myGUI.buttons.MyButtonCancel();
    bt_google = new myComponents.myGUI.buttons.MyDefaultButton(MyAbstractButton.GOOGLE_CODE,"Report to google code tracker");
    bt_email = new myComponents.myGUI.buttons.MyDefaultButton(MyAbstractButton.EMAIL,"Contact by email");

    setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);

    outer.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

    jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

    jScrollPane1.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
    jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    jScrollPane1.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
    jScrollPane1.setOpaque(false);

    jTextArea1.setColumns(20);
    jTextArea1.setEditable(false);
    jTextArea1.setFont(jTextArea1.getFont().deriveFont(jTextArea1.getFont().getSize()+1f));
    jTextArea1.setLineWrap(true);
    jTextArea1.setRows(5);
    jTextArea1.setText("If you want to contact for any comments or suggestions click on the email icon.\nIf you want to report a bug and you have a google account you can report it in the google code tracker by clicking the goggle code button. If you don't have a google account click the email icon to report it via email");
    jTextArea1.setWrapStyleWord(true);
    jTextArea1.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
    jTextArea1.setOpaque(false);
    jScrollPane1.setViewportView(jTextArea1);

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
      jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel1Layout.createSequentialGroup()
        .addContainerGap()
        .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 356, Short.MAX_VALUE)
        .addContainerGap())
    );
    jPanel1Layout.setVerticalGroup(
      jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
        .addContainerGap()
        .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE)
        .addContainerGap())
    );

    jLabel1.setFont(jLabel1.getFont().deriveFont(jLabel1.getFont().getStyle() | java.awt.Font.BOLD, jLabel1.getFont().getSize()+2));
    jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jLabel1.setText("Contact or report a bug");

    bt_cancel.setToolTipText("Close");
    bt_cancel.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        bt_cancelActionPerformed(evt);
      }
    });

    bt_google.setToolTipText("Google code report");
    bt_google.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        bt_googleActionPerformed(evt);
      }
    });

    bt_email.setToolTipText("Contact by email");
    bt_email.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        bt_emailActionPerformed(evt);
      }
    });

    javax.swing.GroupLayout outerLayout = new javax.swing.GroupLayout(outer);
    outer.setLayout(outerLayout);
    outerLayout.setHorizontalGroup(
      outerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(outerLayout.createSequentialGroup()
        .addContainerGap()
        .addGroup(outerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addGroup(outerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(outerLayout.createSequentialGroup()
              .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
              .addContainerGap())
            .addComponent(bt_cancel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, outerLayout.createSequentialGroup()
              .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 325, javax.swing.GroupLayout.PREFERRED_SIZE)
              .addGap(36, 36, 36)))
          .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, outerLayout.createSequentialGroup()
            .addComponent(bt_email, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(bt_google, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
    );
    outerLayout.setVerticalGroup(
      outerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(outerLayout.createSequentialGroup()
        .addGroup(outerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
          .addComponent(bt_cancel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
          .addComponent(jLabel1))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        .addGroup(outerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
          .addComponent(bt_google, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
          .addComponent(bt_email, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
    );

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addComponent(outer, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    );
    layout.setVerticalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addComponent(outer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    );

    pack();
  }// </editor-fold>//GEN-END:initComponents

    private void bt_cancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_cancelActionPerformed
      MySeriesLogger.logger.log(Level.INFO, "Cancelled by the user");
      way = NONE;
      dispose();
      myseriesproject.MySeries.glassPane.deactivate();
    }//GEN-LAST:event_bt_cancelActionPerformed

    private void bt_googleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_googleActionPerformed
      MySeriesLogger.logger.log(Level.INFO, "Report in google code");
      way = GOOGLE_CODE;
      dispose();
       myseriesproject.MySeries.glassPane.deactivate();
    }//GEN-LAST:event_bt_googleActionPerformed

    private void bt_emailActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_emailActionPerformed
      MySeriesLogger.logger.log(Level.INFO, "Contact by email");
      way = EMAIL;
      dispose();
       myseriesproject.MySeries.glassPane.deactivate();
    }//GEN-LAST:event_bt_emailActionPerformed

  // Variables declaration - do not modify//GEN-BEGIN:variables
  private myComponents.myGUI.buttons.MyButtonCancel bt_cancel;
  private myComponents.myGUI.buttons.MyDefaultButton bt_email;
  private myComponents.myGUI.buttons.MyDefaultButton bt_google;
  private javax.swing.JLabel jLabel1;
  private javax.swing.JPanel jPanel1;
  private javax.swing.JScrollPane jScrollPane1;
  private javax.swing.JTextArea jTextArea1;
  private javax.swing.JPanel outer;
  // End of variables declaration//GEN-END:variables
}
